package com.tmt.im.common.pojo;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.tmt.im.common.annotation._AllowUpdate;
import com.tmt.im.common.enums.RedPackageType;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.SuperBuilder;
import org.apache.ignite.cache.query.annotations.QuerySqlField;

import java.io.Serial;
import java.sql.Timestamp;

/**
 * @Description TODO
 * @Author wuyi
 * @Date 2024/9/2 12:32
 * @Version 1.0
 **/
@Getter
@Setter
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
public class RedPackageSkinPoJo implements IGetKey<Long> {

    @Serial
    private static final long serialVersionUID = -1192430363803030126L;

    public static final String CACHE_NAME = "red_package_skin";

    @QuerySqlField(name = "id", index = true)
    private Long id;

    @QuerySqlField(name = "name")
    @_AllowUpdate
    private String name;

    @QuerySqlField(name = "extend_name")
    @_AllowUpdate
    private String extendName;

    @QuerySqlField(name = "type")
    @JsonIgnore
    private String type;

    @QuerySqlField(name = "url")
    private String url;

    @QuerySqlField(name = "creator_id")
    @_AllowUpdate
    @JsonIgnore
    private Long creatorId;

    @QuerySqlField(name = "create_time")
    @_AllowUpdate
    @JsonIgnore
    private Timestamp createTime;

    @QuerySqlField(name = "version")
    @_AllowUpdate
    @JsonIgnore
    private Long version;

    @JsonIgnore
    private boolean insert;

    @Override
    public Long getKey() {
        return id;
    }
}
